package com.reason.chat;

import com.reason.chat.Config.TokenDecode;
import com.reason.common.interceptor.FeignInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;

/**
 * @author 熊钒汐
 * @date 2020/6/30 9:16
 */
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients(basePackages = {"com.reason.user.feign"})
@MapperScan("com.reason.chat.Mapper")
public class ChatApplication {
    public static void main(String[] args) {
        SpringApplication.run(ChatApplication.class,args);
    }
    /**
     * 解析令牌的类
     * @return
     */
    @Bean
    public TokenDecode getTokenDecode(){
        return new TokenDecode();
    }

    @Bean
    FeignInterceptor feignInterceptor()
    {
        return new FeignInterceptor();
    }
}
